﻿Namespace ViewModel

    Public Class LiveProgramSubsetViewModel
        Inherits ViewBase
        Implements IComparable(Of LiveProgramSubsetViewModel), IComparable




        Private Model As Model.LiveProgramModel

        Public Sub New(ByVal liveProgram As Model.LiveProgramModel)
            Model = liveProgram
        End Sub

        Public Property Title() As String
            Get
                Return Model.Title
            End Get
            Set(ByVal value As String)
                Model.Title = value
            End Set
        End Property

        Public ReadOnly Property IsMemberOnly() As Boolean
            Get
                Return Model.IsMemberOnly
            End Get
        End Property

        Public ReadOnly Property IsFace() As Boolean
            Get
                Return Model.IsFace
            End Get
        End Property

        'Public Overrides Function ToString() As String
        '    Return Title
        'End Function

        Public Function CompareTo(ByVal other As LiveProgramSubsetViewModel) As Integer Implements System.IComparable(Of LiveProgramSubsetViewModel).CompareTo
            If other.Title > Me.Title Then
                Return -1
            ElseIf other.Title < Me.Title Then
                Return 1
            Else
                Return 0
            End If
        End Function



        Public Function CompareTo1(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
            Dim p = DirectCast(obj, LiveProgramSubsetViewModel)
            If p.Title > Me.Title Then
                Return -1
            ElseIf p.Title < Me.Title Then
                Return 1
            Else
                Return 0
            End If
        End Function
    End Class
End Namespace
